def quick_sort(a,l,r):
    less=l-1

    for i in range(l,r-l+1):
        if(a[i]>a[r]):
           pass
        else:
            a[i],a[less+1]=swap(a[i],a[less+1])
            less=less+1
    print(less)
    return a

def swap(a,b):
    temp=b
    b=a
    a=temp
    return a,b

a=[4,5,1,5,3,7,6]
a=quick_sort(a,0,len(a)-1)
print(a)